package com.coding.easier.enums;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author: D丶Cheng
 * @Description 语言枚举
 * @Date 2021/11/15 9:46
 **/
public enum LanguagesEnum {

    /**
     * 自动检测
     */
    AUTO("自动检测", "auto", "auto"),

    /**
     * 中文
     */
    CHINESE("中文", "chinese", "zh-CN"),

    /**
     * 英语
     */
    ENGLISH("英语", "english", "en"),

    /**
     * 中文(繁体)
     */
    CHINESE_TRADITIONAL("中文(繁体)", "chinese.traditional", "zh-TW"),

//    /**
//     * 文言文
//     */
//    CHINESE_CLASSICAL("文言文", "chinese.classical", "zh-CLASSICAL"),
//
//    /**
//     * 粤语
//     */
//    CHINESE_CANTONESE("粤语", "chinese.cantonese", "zh-CANTONESE"),

    /**
     * 阿尔巴尼亚语
     */
    ALBANIAN("阿尔巴尼亚语", "albanian", "sq"),

    /**
     * 阿拉伯语
     */
    ARABIC("阿拉伯语", "arabic", "ar"),

    /**
     * 阿姆哈拉语
     */
    AMHARIC("阿姆哈拉语", "amharic", "am"),

    /**
     * 阿塞拜疆语
     */
    AZERBAIJANI("阿塞拜疆语", "azerbaijani", "az"),

    /**
     * 爱尔兰语
     */
    IRISH("爱尔兰语", "irish", "ga"),

    /**
     * 爱沙尼亚语
     */
    ESTONIAN("爱沙尼亚语", "estonian", "et"),

    /**
     * 巴斯克语
     */
    BASQUE("巴斯克语", "basque", "eu"),

    /**
     * 白俄罗斯语
     */
    BELARUSIAN("白俄罗斯语", "belarusian", "be"),

    /**
     * 保加利亚语
     */
    BULGARIAN("保加利亚语", "bulgarian", "bg"),

    /**
     * 冰岛语
     */
    ICELANDIC("冰岛语", "icelandic", "is"),

    /**
     * 波兰语
     */
    POLISH("波兰语", "polish", "pl"),

    /**
     * 波斯尼亚语
     */
    BOSNIAN("波斯尼亚语", "bosnian", "bs"),

    /**
     * 波斯语
     */
    PERSIAN("波斯语", "persian", "fa"),

    /**
     * 布尔语(南非荷兰语)
     */
    AFRIKAANS("布尔语(南非荷兰语)", "afrikaans", "af"),

    /**
     * 丹麦语
     */
    DANISH("丹麦语", "danish", "da"),

    /**
     * 德语
     */
    GERMAN("德语", "german", "de"),

    /**
     * 俄语
     */
    RUSSIAN("俄语", "russian", "ru"),

    /**
     * 法语
     */
    FRENCH("法语", "french", "fr"),

    /**
     * 菲律宾语
     */
    FILIPINO("菲律宾语", "filipino", "tl"),

    /**
     * 芬兰语
     */
    FINNISH("芬兰语", "finnish", "fi"),

    /**
     * 弗里西语
     */
    FRISIAN("弗里西语", "frisian", "fy"),

    /**
     * 高棉语
     */
    KHMER("高棉语", "khmer", "km"),

    /**
     * 格鲁吉亚语
     */
    GEORGIAN("格鲁吉亚语", "georgian", "ka"),

    /**
     * 古吉拉特语
     */
    GUJARATI("古吉拉特语", "gujarati", "gu"),

    /**
     * 哈萨克语
     */
    KAZAKH("哈萨克语", "kazakh", "kk"),

    /**
     * 海地克里奥尔语
     */
    HAITIAN_CREOLE("海地克里奥尔语", "haitianCreole", "ht"),

    /**
     * 韩语
     */
    KOREAN("韩语", "korean", "ko"),

    /**
     * 豪萨语
     */
    HAUSA("豪萨语", "hausa", "ha"),

    /**
     * 荷兰语
     */
    DUTCH("荷兰语", "dutch", "nl"),

    /**
     * 吉尔吉斯语
     */
    KYRGYZ("吉尔吉斯语", "kyrgyz", "ky"),

    /**
     * 加利西亚语
     */
    GALICIAN("加利西亚语", "galician", "gl"),

    /**
     * 加泰罗尼亚语
     */
    CATALAN("加泰罗尼亚语", "catalan", "ca"),

    /**
     * 捷克语
     */
    CZECH("捷克语", "czech", "cs"),

    /**
     * 卡纳达语
     */
    KANNADA("卡纳达语", "kannada", "kn"),

    /**
     * 科西嘉语
     */
    CORSICAN("科西嘉语", "corsican", "co"),

    /**
     * 克罗地亚语
     */
    CROATIAN("克罗地亚语", "croatian", "hr"),

    /**
     * 库尔德语
     */
    KURDISH("库尔德语", "kurdish", "ku"),

    /**
     * 拉丁语
     */
    LATIN("拉丁语", "latin", "la"),

    /**
     * 拉脱维亚语
     */
    LATVIAN("拉脱维亚语", "latvian", "lv"),

    /**
     * 老挝语
     */
    LAO("老挝语", "lao", "lo"),

    /**
     * 立陶宛语
     */
    LITHUANIAN("立陶宛语", "lithuanian", "lt"),

    /**
     * 卢森堡语
     */
    LUXEMBOURGISH("卢森堡语", "luxembourgish", "lb"),

    /**
     * 卢旺达语
     */
    KINYARWANDA("卢旺达语", "kinyarwanda", "rw"),

    /**
     * 罗马尼亚语
     */
    ROMANIAN("罗马尼亚语", "romanian", "ro"),

    /**
     * 马尔加什语
     */
    MALAGASY("马尔加什语", "malagasy", "mg"),

    /**
     * 马耳他语
     */
    MALTESE("马耳他语", "maltese", "mt"),

    /**
     * 马拉地语
     */
    MARATHI("马拉地语", "marathi", "mr"),

    /**
     * 马拉雅拉姆语
     */
    MALAYALAM("马拉雅拉姆语", "malayalam", "ml"),

    /**
     * 马来语
     */
    MALAY("马来语", "malay", "ms"),

    /**
     * 马其顿语
     */
    MACEDONIAN("马其顿语", "macedonian", "mk"),

    /**
     * 毛利语
     */
    MAORI("毛利语", "maori", "mi"),

    /**
     * 蒙古语
     */
    MONGOLIAN("蒙古语", "mongolian", "mn"),

    /**
     * 孟加拉语
     */
    BENGALI("孟加拉语", "bengali", "bn"),

    /**
     * 缅甸语
     */
    MYANMAR("缅甸语", "myanmar", "my"),

    /**
     * 苗语
     */
    HMONG("苗语", "hmong", "hmn"),

    /**
     * 南非科萨语
     */
    XHOSA("南非科萨语", "xhosa", "xh"),

    /**
     * 南非祖鲁语
     */
    ZULU("南非祖鲁语", "zulu", "zu"),

    /**
     * 尼泊尔语
     */
    NEPALI("尼泊尔语", "nepali", "ne"),

    /**
     * 挪威语
     */
    NORWEGIAN("挪威语", "norwegian", "no"),

    /**
     * 旁遮普语
     */
    PUNJABI("旁遮普语", "punjabi", "pa"),

    /**
     * 葡萄牙语
     */
    PORTUGUESE("葡萄牙语", "portuguese", "pt"),

    /**
     * 普什图语
     */
    PASHTO("普什图语", "pashto", "ps"),

    /**
     * 齐切瓦语
     */
    CHICHEWA("齐切瓦语", "chichewa", "ny"),

    /**
     * 日语
     */
    JAPANESE("日语", "japanese", "ja"),

    /**
     * 瑞典语
     */
    SWEDISH("瑞典语", "swedish", "sv"),

    /**
     * 萨摩亚语
     */
    SAMOAN("萨摩亚语", "samoan", "sm"),

    /**
     * 塞尔维亚语
     */
    SERBIAN("塞尔维亚语", "serbian", "sr"),

    /**
     * 塞索托语
     */
    SESOTHO("塞索托语", "sesotho", "st"),

    /**
     * 僧伽罗语
     */
    SINHALA("僧伽罗语", "sinhala", "si"),

    /**
     * 世界语
     */
    ESPERANTO("世界语", "esperanto", "eo"),

    /**
     * 斯洛伐克语
     */
    SLOVAK("斯洛伐克语", "slovak", "sk"),

    /**
     * 斯洛文尼亚语
     */
    SLOVENIAN("斯洛文尼亚语", "slovenian", "sl"),

    /**
     * 斯瓦希里语
     */
    SWAHILI("斯瓦希里语", "swahili", "sw"),

    /**
     * 苏格兰盖尔语
     */
    SCOTS_GAELIC("苏格兰盖尔语", "scotsGaelic", "gd"),

    /**
     * 宿务语
     */
    CEBUANO("宿务语", "cebuano", "ceb"),

    /**
     * 索马里语
     */
    SOMALI("索马里语", "somali", "so"),

    /**
     * 塔吉克语
     */
    TAJIK("塔吉克语", "tajik", "tg"),

    /**
     * 泰卢固语
     */
    TELUGU("泰卢固语", "telugu", "te"),

    /**
     * 泰米尔语
     */
    TAMIL("泰米尔语", "tamil", "ta"),

    /**
     * 泰语
     */
    THAI("泰语", "thai", "th"),

    /**
     * 土耳其语
     */
    TURKISH("土耳其语", "turkish", "tr"),

    /**
     * 土库曼语
     */
    TURKMEN("土库曼语", "turkmen", "tk"),

    /**
     * 威尔士语
     */
    WELSH("威尔士语", "welsh", "cy"),

    /**
     * 乌尔都语
     */
    URDU("乌尔都语", "urdu", "ur"),

    /**
     * 乌克兰语
     */
    UKRAINIAN("乌克兰语", "ukrainian", "uk"),

    /**
     * 乌兹别克语(乌孜别克语)
     */
    UZBEK("乌兹别克语(乌孜别克语)", "uzbek", "uz"),

    /**
     * 西班牙语
     */
    SPANISH("西班牙语", "spanish", "es"),

    /**
     * 希伯来语
     */
    HEBREW("希伯来语", "hebrew", "iw"),

    /**
     * 希腊语
     */
    GREEK("希腊语", "greek", "el"),

    /**
     * 夏威夷语
     */
    HAWAIIAN("夏威夷语", "hawaiian", "haw"),

    /**
     * 信德语
     */
    SINDHI("信德语", "sindhi", "sd"),

    /**
     * 匈牙利语
     */
    HUNGARIAN("匈牙利语", "hungarian", "hu"),

    /**
     * 修纳语
     */
    SHONA("修纳语", "shona", "sn"),

    /**
     * 亚美尼亚语
     */
    ARMENIAN("亚美尼亚语", "armenian", "hy"),

    /**
     * 伊博语
     */
    IGBO("伊博语", "igbo", "ig"),

    /**
     * 意大利语
     */
    ITALIAN("意大利语", "italian", "it"),

    /**
     * 意第绪语
     */
    YIDDISH("意第绪语", "yiddish", "yi"),

    /**
     * 印地语
     */
    HINDI("印地语", "hindi", "hi"),

    /**
     * 印尼巽他语
     */
    SUNDANESE("印尼巽他语", "sundanese", "su"),

    /**
     * 印尼语
     */
    INDONESIAN("印尼语", "indonesian", "id"),

    /**
     * 印尼爪哇语
     */
    JAVANESE("印尼爪哇语", "javanese", "jw"),

    /**
     * 约鲁巴语
     */
    YORUBA("约鲁巴语", "yoruba", "yo"),

    /**
     * 越南语
     */
    VIETNAMESE("越南语", "vietnamese", "vi");

    private String showName;
    private String langNameKey;
    private String code;

    LanguagesEnum(String showName, String langNameKey, String code) {
        this.showName = showName;
        this.langNameKey = langNameKey;
        this.code = code;
    }

    LanguagesEnum(String langNameKey, String code) {
        this.langNameKey = langNameKey;
        this.code = code;
    }

    public static String getLanguageCodeByIndex(int index) {
        return LanguagesEnum.values()[index].getCode();
    }

    public String getShowName() {
        return showName;
    }

    public void setShowName(String showName) {
        this.showName = showName;
    }

    public String getLangNameKey() {
        return langNameKey;
    }

    public void setLangNameKey(String langNameKey) {
        this.langNameKey = langNameKey;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static List<String> getAllLanguages() {
        List<String> languages = new ArrayList<>();
        for (LanguagesEnum value : LanguagesEnum.values()) {
            languages.add(value.getShowName());
        }
        return languages;
    }

    //    public static List<LanguagesEnum> getAllLanguages() {
    //        return new ArrayList<>(Arrays.asList(LanguagesEnum.values()));
    //    }
}
